<link rel="stylesheet" href="images/style.css" type="text/css" media="all" />
<?php
$state = true;
function zhengshu(){
	if(!file_exists('code.pfx')){
		echo "<tr><td>code.pfx</td><td class=\"padleft\">已上传</td><td clas=\"w pdleft1\">是</td></tr>";
		}else{
			echo "<tr><td>code.pfx</td><td class=\"padleft\"><button>未上传</button></td><td clas=\"w pdleft1\">否</td></tr>";
			}
	}
?>
<script language="javascript" type="text/javascript"> 
function openwinx(url,name,w,h)
{
    window.open(url,name,"top=100,left=400,width=" + w + ",height=" + h + ",toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no");
}
</script>
<script language="javascript" type="text/javascript" src="jquery.js"></script>
<script language="javascript" type="text/javascript">
$(document).ready(function(){
  $('#datapwd').blur(function(){
	var dataname=$('#dataname').val();
	var datapwd=$('#datapwd').val();
	var host=$('#host').val();
	  $.post("jiance.php", { "dataname": dataname,"datapwd": datapwd,"host":host},function(data){
	  if(data==0){
		  $('#jieguo').html("&nbsp;数据库连接失败");
		  $('#jieguo').css("color","#F00");
		  $('.btn').attr("disabled",true);
		  }else{
			  $('#jieguo').html("&nbsp;数据库连接成功");
			  $('.btn').attr("disabled",false);
			  }
      });
	});
});
</script>
<script src="images/jquery-1.2.2.pack.js" type="text/javascript"></script>
<link href="images/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<script src="images/facebox.js" type="text/javascript"></script>

<script type="text/javascript">
    jQuery(document).ready(function($) {
      $('a[rel*=facebox]').facebox();
	  $('#check_admin_pwd').blur(function(){
	      var l =$(this).val().length;
		  if(l>5 && l<11){
			  $('#xiayibu').attr('disabled','');
		  }
		  else{
			  alert('管理员密码要在6-10位之间');
			  }
	  });
    })
</script>
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
.STYLE3 {
	color: #FF0000;
	font-size: 14px;
	font-weight: bold;
}

-->
</style>
<div class="container">
	<div class="header">
		<h1>UCenter 安装向导</h1>

		<span>官方 <a href="http://soft.duoduo123.com" target="_blank">http://soft.duoduo123.com</a></span>
		<span style="margin-right:40px"> 简体中文 UTF8 版 V7.1  20110407</span>	
		<div class="setup step2">
		<h2>安装数据库</h2>
		<p>正在执行数据库安装</p>
	</div>
	<div class="stepstat">
		<ul>
			<li class="">1</li>

			<li class="current">2</li>
			<li class="unactivated">3</li>
			<li class="unactivated last">4</li>
		</ul>
		<div class="stepstatbg stepstat2"></div>
	</div>
</div>

<div class="main">
<form method="post" action="install.php">
  <div class="desc"><b>多多淘宝客授权信息</b> <br />
    填写您自助购买时或找回的授权码，<span class="STYLE1">授权码与授权证书要相对应</span>，否则无法安装！</div>
  <table width="508" class="tb2" style=" background-color:#FFFF99">
    <tr>
      <th height="30" class="tbopt"><span class="STYLE3">授权检测</span></th>
      <td align="center" valign="middle" class="padleft">商业客户 <a href="http://pay.duoduo123.com/get_key.php" target="_blank">获取</a> &nbsp;&nbsp;&nbsp;测试用户 <a href="#mydiv" rel="facebox">获取</a></td>
    </tr>
    <tr>
      <th width="128" height="30" class="tbopt">证书(code.pfx):</th>
      <td width="208" align="center" valign="middle" class="padleft"><?php if(file_exists('code.pfx')){ echo "已上传";}else{echo "<button onclick=\"javascript:openwinx('upload.php?uploadtext=zhengshu','upload','900','350')\" >点击上传</button>";$state = false;}?>
        &nbsp;&nbsp;&nbsp;</td>
      <?php if(file_exists('code.pfx')){ echo "<td class='w pdleft1'>是</td>";}else{echo "<td class='nw pdleft1'>否</td>";}?>
    </tr>
    <tr>
      <th height="30" class="tbopt"><div align="right">授 权 码:</div></th>
      <td align="center" valign="middle"><input type="text" name="taobao[taokecode]" value="<?php echo isset($_POST['taobao']['taokecode']) ? $_POST['taobao']['taokecode'] :''?>" size="35" class="txt" /></td>
      <td width="77" align="left" valign="middle">&nbsp;</td>
      <td width="77" align="left" valign="middle"><font color="red" style="float:right">*必填</font></td>
    </tr>
    <tr>
      <th height="30" class="tbopt"><div align="right">AppSecret:</div></th>
      <td align="center" valign="middle"><input type="text" name="sec" value="" size="35" class="txt" /></td>
      <td width="77" align="left" valign="middle"><a href="http://soft.duoduo123.com/help/templets/2010/0928/108.html" target="_blank">获取</a></td>
      <td width="77" align="left" valign="middle"><font color="red" style="float:right; line-height:13px;">*必填</font></td>
    </tr>
    <?php if(!empty($error['taobao'])):?>
    <tr>
      <th align="center" valign="middle" class="tbopt nw">&nbsp;</th>
      <td align="center" valign="middle"><font color="red"><?php echo $error['taobao'];?></font></td>
      <td colspan="2" align="center" valign="middle">&nbsp;</td>
    </tr>
    <?php endif;print_r($error['appsec']);?>
  </table>
  <p>&nbsp;</p>
<table class="tb2">
<input type="hidden" name="step" value="2">
<div class="desc"><b>填写数据库信息</b></div>
<tr>
<th width="128" class="tbopt">&nbsp;数据库IP(地址):</th>
<td width="208"><input type="text" name="db[host]" value="<?php echo isset($_POST['db']['host']) ? $_POST['db']['host'] :'localhost'?>" size="35" class="txt" id="host"></td>
<td width="243">&nbsp;一般为localhost或IP:XX.XX.XX.XX</td>
</tr>

<tr><th class="tbopt">&nbsp;数据库名称:</th>
<td><input type="text" name="db[dbname]" value="" size="35" class="txt"></td>
<td>请到数据库管理内查找</td>
</tr>

<tr><th class="tbopt">&nbsp;数据库用户:</th>
<td><input type="text" name="db[username]" value="" size="35" class="txt" id="dataname"></td>
<td>同上</td>
</tr>

<tr><th class="tbopt">&nbsp;数据库密码:</th>
<td><input type="password" name="db[password]" value="<?php echo isset($_POST['db']['password']) ? $_POST['db']['password'] :''?>" size="35" class="txt" id="datapwd"></td>
<td id="jieguo" style="color:#F00"></td>
</tr>

<tr><th class="tbopt">&nbsp;数据表前缀:</th>
<td><input type="text" name="db[prefix]" value="<?php echo isset($_POST['db']['prefix']) ? $_POST['db']['prefix'] :'duoduo_'?>" size="35" class="txt"></td>
<td>&nbsp;同一数据库运行多个网站时，请修改前缀</td>
</tr>
<?php if(!empty($error['db'])):?>
<tr><th class="tbopt nw" align="right">&nbsp;</th>
<td><font color=red><?php echo $error['db'];?></font></td>
<td>&nbsp;</td>
</tr>
<?php endif;?>
</table>

<div class="desc">
<b>填写管理员信息</b>
<br>请牢记 管理员名称和密码，只有该密码才能登陆后台进行数据管理工作。</div><table class="tb2">
<tr><th class="tbopt">&nbsp;管理员名称:</th>
<td><input type="text" name="admin[adminuser]" value="<?php echo isset($_POST['admin']['adminuser']) ? $_POST['admin']['adminuser'] :'admin'?>" size="35" class="txt"></td>
<td>&nbsp;</td>
</tr>

<tr><th class="tbopt">&nbsp;管理员密码:</th>
<td><input type="password" name="admin[adminpassword]" value="<?php echo isset($_POST['admin']['adminpassword']) ? $_POST['admin']['adminpassword'] :''?>" id="check_admin_pwd" size="35" class="txt"></td>
<td>&nbsp;</td>
</tr>
<?php if(!empty($error['admin'])):?>
<tr><th class="tbopt nw" align="right">&nbsp;</th>
<td><font color=red><?php echo $error['admin'];?></font></td>
<td>&nbsp;</td>
</tr>
<?php endif;?>
</table>

<table width="508" class="tb2">
  <?php if(!empty($error['taobao'])):?>
  <?php endif;?>
  <tr>
    <th align="center" valign="middle" class="tbopt">&nbsp;</th>
    <td align="center" valign="middle"><input type="submit" value="下一步" class="btn" id="xiayibu" disabled="disabled" /></td>
    <td align="center" valign="middle">&nbsp;</td>
  </tr>
</table>
<p>&nbsp;</p>
<div class="desc"></div>
</form>
<input type="text" id="aa"  onclick="window.location.href='install.php?step=2';" style="display:none" />
<div class="footer"><a href="http://soft.duoduo123.com/show/install" target="_blank">查看视频安装教程</a> <a href="http://soft.duoduo123.com/help/inat" target="_blank">帮助中心</a></div>
	<div class="footer">&copy;2008 - 2011 <a href="http://soft.duoduo123.com/">soft.duoduo123.com</a></div>
	</div>
</div>
<div id="mydiv" style="display:none">
注意不要带空格！请左键选择复制一下代码<br /><br />
<span>证  书：<br/><br /></span><a href="../upload/code.pfx">立刻下载</a>
<br /><br />
<span>授权码：</span><br/><br />AxVVNltmXWMAMgMxVTYDNgFoATUGOAAwCzFTYlA7<br /><br />
<span>AppSecret：</span><br /><br />f89e13c0737443393f867bab5702c367<br /><br />
</div>

